package com.itheima.mymath;

public class demo1 {
    public static void main(String[] args) {
        //取绝对值
        int abs = Math.abs(-10);
        System.out.println(abs);

        //向上取整
        double ceil = Math.ceil(10.5);
        System.out.println(ceil);

        //向下取整
        double floor = Math.floor(12.1);
        System.out.println(floor);

        //四舍五入
        long round = Math.round(17.5);
        System.out.println(round);

        //生成随机小数,范围[0.0,1.0)
        double random = Math.random();
        System.out.println(random);

        //范围[0.0,100.0)
        double random1 = Math.random() * 100;
        System.out.println(random1);

        //a的b次幂
        double p = Math.pow(2, 5);
        System.out.println(p);
    }
}
